﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using COM.Rights.Model;
using COM.Rights.BLL;
using COM.PreAlarm.Model;
using COM.PreAlarm.BLL;

public partial class Pages_PermUserWeb_Default : ZMPageList<PermUserWeb,PermUserWebInfo>
{  
	#region 重写方法

    protected override void OnLoading()
    {
        if (!IsPostBack)
        {
            MdlistInfo _MdlistInfo = new MdlistInfo();
            _MdlistInfo.TranType = "GetDetailByCity";
            _MdlistInfo.UID = ZConfig.ReadAppSettings("Area"); ;
            ZABinder.FillList(string.Empty,ddlCity,true, Mdlist.GetDataTableByModel(_MdlistInfo));

            _MdlistInfo.TranType = "GetUser";
            ZABinder.FillList(string.Empty, ddlAccount, true, Mdlist.GetDataTableByModel(_MdlistInfo));
        }
    }



    protected override string DefaultSortField
    {
        get
        {
            return "LastEditDate DESC,UID";
        }
    }


    //不显示保存按纽
    protected override void InitBtnSave()
    {
        //base.InitBtnSave();
        
    }

    //不显示保存按纽
    protected override void  InitBtnAdd()
    {
 	     //base.InitBtnAdd();
    }

    //不显示保存按纽
    protected override void  InitBtnSearch()
    {
 	     //base.InitBtnSearch();
    }
   

    protected override int PageSize
    {
        get
        {
            return 100;
        }
    }


    protected void btnReply_Click(object sender, EventArgs e)
    {
        if (ddlAccount.SelectedValue != "" && ddlCity.SelectedValue != "")
        {
            PermUserWebInfo puwi = new PermUserWebInfo();
            puwi.UID = ddlAccount.SelectedValue;
            puwi.HostName = ddlCity.SelectedValue;
            puwi.LastEditBy = ZASession.Account;
            puwi.LastEditDate = DateTime.Now;
            PermUserWeb puw = new PermUserWeb();
            puw.Add(puwi, "*");
            OnGridChanged();
        }
        
    }
	#endregion 	重写方法
}